数据分析的话我觉得会是以后必不可少或者是非常需要的一个行业，因为他可以通过数据来判断出一个人的性格爱好或者一些其他生活上的特别的小爱好。



import sys
import re

p = re.compile(r'\w+')
for line in sys.stdin:
    ss = line.strip().split(' ')
    for s in ss:
        if len(p.findall(s)) < 1:
            continue
        s_low = p.findall(s)[0].lower()
        print(s_low + ',' + '1')


import sys

cur_word = None
sum = 0
for line in sys.stdin:
    word, val = line.strip().split(',')
    if cur_word == None:
        cur_word = word
    if cur_word != word:
        print('%s\t%s' % (cur_word, sum))
        cur_word = word
        sum = 0
    sum += int(val)
print('%s\t%s' % (cur_word, sum))

cat The_Man_of_Property.txt | python map_t.py |sort -k2|python red_t.py


HADOOP_CMD="/usr/local/src/hadoop-2.6.1/bin/hadoop"
STREAM_JAR_PATH="/usr/local/src/hadoop-2.6.1/share/hadoop/tools/lib/hadoop-streaming-2.6.1.jar"

INPUT_FILE_PATH_1="/data/The_Man_of_Property.txt"
OUTPUT_PATH="/output/wc"

$HADOOP_CMD fs -rmr -skipTrash $OUTPUT_PATH

$HADOOP_CMD jar $STREAM_JAR_PATH \
    -input $INPUT_FILE_PATH_1 \
    -output $OUTPUT_PATH \
    -mapper "python map_t.py" \
    -reducer "python red_t.py" \
    -file ./map_t.py \
    -file ./red_t.py



